#

lib_LTLIBRARIES = libwtk.la

libwtk_la_CPPFLAGS = \
	-I$(top_srcdir) \
	-I$(top_builddir) \
	-DWTK_COMPILE \
	-DWTK_DATADIR=\"$(pkgdatadir)\" \
	@WTK_CFLAGS@ \
	@WGL_CFLAGS@

libwtk_la_LDFLAGS = \
	@WTK_LDFLAGS@ \
	-no-undefined

libwtk_la_LIBADD = \
	@WTK_LIBS@ \
	@WGL_LIBS@

libwtk_la_SOURCES = \
	wtkapplication.cpp \
	wtkwm.cpp \
	wtkdisplay.cpp \
	wtklayout.cpp \
	wtkbinlayout.cpp \
	wtkwidget.cpp \
	wtkrootwidget.cpp \
	wtkdialog.cpp \
	wtklabel.cpp

WTKHDRS = \
	wtk.hpp \
	wtkbase.hpp \
	wtkapplication.hpp \
	wtkevent.hpp \
	wtkfpscounter.hpp \
	wtkwm.hpp \
	wtkdisplay.hpp \
	wtklayout.hpp \
	wtkbinlayout.hpp \
	wtkwidget.hpp \
	wtkrootwidget.hpp \
	wtkdialog.hpp \
	wtklabel.hpp

# [FIXME] make rm and symlinks optional (and off by default)
install-exec-hook:
	rm -rf "$(pkgincludedir)"
	test -d "$(pkgincludedir)" || $(MKDIR_P) "$(pkgincludedir)"
	for hdr in $(WTKHDRS); do \
		src="$(abs_top_srcdir)/wtk/$${hdr}"; \
		test -f "$${src}" || { echo "E: header not found: '$${src}'" >&2; exit 1; }; \
		dst="$(DESTDIR)$(pkgincludedir)/$${hdr}"; \
		$(LN_S) "$${src}" "$${dst}"; \
	done
